clear;

T = 3.0;

eta = 1.0;

result(2,1)=backwardeuler(T,eta,0.2);
result(2,2)=trapezoidal(T,eta,0.2);
result(3,1)=backwardeuler(T,eta,0.1);
result(3,2)=trapezoidal(T,eta,0.1);
result(1,1)=backwardeuler(T,eta,0.05);
result(1,2)=trapezoidal(T,eta,0.05);

eta = 1.5;

result(5,1)=backwardeuler(T,eta,0.2);
result(5,2)=trapezoidal(T,eta,0.2);
result(6,1)=backwardeuler(T,eta,0.1);
result(6,2)=trapezoidal(T,eta,0.1);
result(4,1)=backwardeuler(T,eta,0.05);
result(4,2)=trapezoidal(T,eta,0.05);

fprintf("%8s %6s %20s %20s \n",'','k','Backward Euler','Trapezoidal');
fprintf("%8s %6s %20e %20e \n",'eta=1','0.2',result(2,1),result(2,2));
fprintf("%8s %6s %20e %20e \n",'','0.1',result(3,1),result(3,2));
fprintf("%8s %6s %20e %20e \n",'','0.05',result(1,1),result(1,2));
fprintf("%8s %6s %20e %20e \n",'eta=1.5','0.2',result(5,1),result(5,2));
fprintf("%8s %6s %20e %20e \n",'','0.1',result(6,1),result(6,2));
fprintf("%8s %6s %20e %20e \n",'','0.05',result(4,1),result(4,2));
